<?

function ptal_function_counter($params,$value,$ptal)
{
    static $counters;
    
    $name = isset($params['name']) ? $params['name'] : '__default';
    unset($params['name']);
    
    if ($counters[$name]<count($params)-1) $counters[$name]++;
    else $counters[$name]=0;
        
    return $params[$counters[$name]];
}
